package com.lagou.tomcat.container;

import com.lagou.tomcat.request.Request;
import com.lagou.tomcat.response.Response;

/**
 * @author zhangjinshan
 * @version 1.0
 * @description
 * @date 2021/7/11 上午10:08
 */
public abstract class HttpServlet implements Servlet {
    public abstract void doGet(Request request, Response response);

    public abstract void doPost(Request request,Response response);


    @Override
    public void service(Request request, Response response) throws Exception {
        if("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request,response);
        }else{
            doPost(request,response);
        }
    }
}
